<?php
header('Content-type:text/html;charset=utf-8');
try{
	$dsn = 'mysql:host=localhost;dbname=db';
	$pdo = new PDO($dsn,'root','');
	$pdo->query("set character set 'utf8'");//读库 
	$pdo->query("set names 'utf8'");//写库 
}catch (PDOException $e){
	echo 'error:'.$e->getMessage();
}
?>